/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rw.magallanes.ide.main;

import com.rw.magallanes.core.Warehouse;
import com.rw.magallanes.db.Storage;
import com.rw.magallanes.db.StorageException;
import com.rw.magallanes.utilities.Utilities;
import java.awt.EventQueue;
import java.io.File;
import java.nio.charset.Charset;

/**
 *
 * @author Gonzalez
 */
public class MainCore {

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    Charset defaultCharset = Charset.defaultCharset();
                    System.out.println(defaultCharset);
                    
                    Utilities.loadLookAndFeel();
                    
                    MainSystem ms = MainSystem.getInstance();
                    Warehouse wh = Utilities.loadWarehouse();

                    MainFrame mf = new MainFrame(wh);
                    ms.setMainFrame(mf);

                    mf.showMe();
                } catch (StorageException ex) {
                    throw new RuntimeException("Excepcion inesperada", ex);
                }
            }
            
        });
    }
}
